


import java.awt.*;
import java.awt.event.*;

import javax.swing.*;

@SuppressWarnings("serial")
public class Simulation2 extends JFrame {
	private JComboBox<String> chooser;
	
	public Simulation2() {
		super("Simulator_AOR2");
		initComponents();
		setVisible(true);
	}

	private void initComponents() {
		JPanel center=new JPanel(new BorderLayout());
		JLabel labCPU=new JLabel();
		labCPU.setIcon(new ImageIcon(getClass().getResource("NASLOVNA2.jpg")));
		center.add("North",labCPU);
		
		JPanel centerDown=new JPanel(new GridLayout(7,1));
		JLabel odabir=new JLabel("Odabir realizacije procesora:");
		odabir.setFont(new Font("Tahoma", Font.BOLD, 12));
		odabir.setHorizontalAlignment(SwingConstants.LEFT );
		centerDown.add(odabir);
		chooser = new JComboBox<String>();
		chooser.setMaximumRowCount(4);
		chooser.setModel(new DefaultComboBoxModel<String>(new String[] {
				"Direktne Veze - Ožičena realizacija",
				"Jedna Magistrala - Vertikalna Mikroprogramska realizacija",
				"Dve Magistrale -  Mešovita Mikroprogramska realizacija",
				"Tri Magistrale - Horizontalna Mikroprograska realizacija" }));
		centerDown.add(chooser);
		JLabel autori=new JLabel("Autori:");
		autori.setHorizontalAlignment(SwingConstants.CENTER );
		autori.setFont(new Font("Tahoma", Font.BOLD, 16));
		centerDown.add(autori);
		JLabel autor1=new JLabel("Vuk Mirović");
		autor1.setHorizontalAlignment(SwingConstants.CENTER );
		autor1.setFont(new Font("Tahoma", Font.ITALIC, 16));
		centerDown.add(autor1);
		JLabel autor2=new JLabel("Đorđe Miladinović");
		autor2.setHorizontalAlignment(SwingConstants.CENTER );
		autor2.setFont(new Font("Tahoma", Font.ITALIC, 16));
		centerDown.add(autor2);
		JLabel autor3=new JLabel("Darko Tamburić");
		autor3.setHorizontalAlignment(SwingConstants.CENTER );
		autor3.setFont(new Font("Tahoma", Font.ITALIC, 16));
		centerDown.add(autor3);
		JLabel autor4=new JLabel("Aleksandar Milić");
		autor4.setHorizontalAlignment(SwingConstants.CENTER );
		autor4.setFont(new Font("Tahoma", Font.ITALIC, 16));
		centerDown.add(autor4);
		center.add("Center",centerDown);
		
		JPanel east=new JPanel(new BorderLayout());
		JLabel labETF=new JLabel();
		labETF.setIcon(new ImageIcon(getClass().getResource("etfsmall.gif")));
		east.add("North",labETF);
		
		JPanel eastDown=new JPanel(new GridLayout(6,1));
		eastDown.add(new JLabel(""));
		eastDown.add(new JLabel(""));
		JButton start=new JButton("START");
		start.setAlignmentX(CENTER_ALIGNMENT);
		start.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				int selektovan = chooser.getSelectedIndex();
				switch (selektovan) {
				case 0:
				    new dvoz.main.Main(Simulation2.this);
					setVisible(false);
					break;
				case 1:
					new jmvm.main.Main();
					setVisible(false);
					break;
				case 2:
					new dmmm.main.Main(Simulation2.this);
					setVisible(false);
					break;
				case 3:
					new tmhm.main.Main();
					setVisible(false);
					break;
				}
			}
		});
		eastDown.add(start);
		east.add("Center",eastDown);
		
		setLayout(new BorderLayout());
		add("Center",center);
		add("East",east);
		setPreferredSize(new Dimension(500,400));
		setSize(new Dimension(500,400));
		setResizable(false);
		validate();
	}

	public static void main(String[] args) {
		new Simulation2();
	}
}